package DB.dto;

import java.io.Serializable;

public class PersonDto implements Serializable
{
	/** 
	 * This attribute maps to the column NAME in the PERSON table.
	 */
	protected String name;

	/** 
	 * This attribute maps to the column LOGIN in the PERSON table.
	 */
	protected String login;

	/** 
	 * This attribute maps to the column PASSWORD in the PERSON table.
	 */
	protected String password;

	/** 
	 * This attribute maps to the column ID_PERSON in the PERSON table.
	 */
	protected int idPerson;

	/**
	 * Method 'PersonDto'
	 * 
	 */
	public PersonDto()
	{
	}

	/**
	 * Method 'getName'
	 * 
	 * @return String
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * Method 'setName'
	 * 
	 * @param name
	 */
	public void setName(String name)
	{
		this.name = name;
	}

	/**
	 * Method 'getLogin'
	 * 
	 * @return String
	 */
	public String getLogin()
	{
		return login;
	}

	/**
	 * Method 'setLogin'
	 * 
	 * @param login
	 */
	public void setLogin(String login)
	{
		this.login = login;
	}

	/**
	 * Method 'getPassword'
	 * 
	 * @return String
	 */
	public String getPassword()
	{
		return password;
	}

	/**
	 * Method 'setPassword'
	 * 
	 * @param password
	 */
	public void setPassword(String password)
	{
		this.password = password;
	}

	/**
	 * Method 'getIdPerson'
	 * 
	 * @return int
	 */
	public int getIdPerson()
	{
		return idPerson;
	}

	/**
	 * Method 'setIdPerson'
	 * 
	 * @param idPerson
	 */
	public void setIdPerson(int idPerson)
	{
		this.idPerson = idPerson;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof PersonDto)) {
			return false;
		}
		
		final PersonDto _cast = (PersonDto) _other;
		if (name == null ? _cast.name != name : !name.equals( _cast.name )) {
			return false;
		}
		
		if (login == null ? _cast.login != login : !login.equals( _cast.login )) {
			return false;
		}
		
		if (password == null ? _cast.password != password : !password.equals( _cast.password )) {
			return false;
		}
		
		if (idPerson != _cast.idPerson) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		if (name != null) {
			_hashCode = 29 * _hashCode + name.hashCode();
		}
		
		if (login != null) {
			_hashCode = 29 * _hashCode + login.hashCode();
		}
		
		if (password != null) {
			_hashCode = 29 * _hashCode + password.hashCode();
		}
		
		_hashCode = 29 * _hashCode + idPerson;
		return _hashCode;
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "DB.dto.PersonDto: " );
		ret.append( "name=" + name );
		ret.append( ", login=" + login );
		ret.append( ", password=" + password );
		ret.append( ", idPerson=" + idPerson );
		return ret.toString();
	}

}
